package com.jmb.api.web.core;

import com.alibaba.fastjson2.JSONObject;
import com.jmb.api.common.result.RelyType;
import com.jmb.api.common.utils.TimeUtil;
import net.sf.jsqlparser.statement.select.KSQLWindow;

import java.util.HashMap;
import java.util.concurrent.TimeUnit;

public interface Node {

    default JSONObject chainNode(RelyType type,Long id, String name, String value, Long runTime, String expression){
        JSONObject object = new JSONObject();
        object.put("type", type);
        object.put("typeDesc",type.getTypeDesc());
        object.put("id", id);
        object.put("name",name);
        object.put("value",value);
        object.put("time", runTime);
        object.put("desc",type.getDesc());
        object.put("expression",expression);
        object.put("date", TimeUtil.date("yyyy-MM-dd HH:mm:ss:SSS"));
        return object;

    }

}
